package com.lgs.demo.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.lgs.demo.utils.LogUtil;

import butterknife.ButterKnife;

/**
 * Created by lgs on 2018/1/28.
 */

public abstract class BaseLazyFragment extends Fragment {

    private boolean isInit = false;//真正要显示的View是否已经被初始化（正常加载）
    private Bundle savedInstanceState;
    public static final String INTENT_BOOLEAN_LAZYLOAD = "intent_boolean_lazyload";
    private boolean isLazyLoad = true;
    private FrameLayout layout;
    //    public LoadingDialog mLoadingDialog;
    private boolean isStart = false;//是否处于可见状态，in the screen


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(getLayoutId(), container, false);
        ButterKnife.bind(this, rootView);
        LogUtil.i("onCreateView");
        return rootView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        init();
    }

    protected abstract int getLayoutId();

    protected void init() {

    }

}
